import { PrimaryGeneratedColumn } from "typeorm";
import { Avatar, Boolean, City, Code, CreateDate, Desc, Digdit, Entity, Int, Name, Province, Time, UpdateDate } from "../utils";

@Entity({
    name: 'ks_account_log'
})
export class KsAccountLog {
    @PrimaryGeneratedColumn()
    id: number;

    @Time()
    time: Date;

    @Int(11, {})
    account_id: number;

    @Boolean()
    living: boolean;
}

/**
 * 主播账号
 */
@Entity({ name: 'ks_account' })
export class KsAccount {

    @PrimaryGeneratedColumn()
    id: number;

    @Code({ comment: '用户ID' })
    user_id: string;

    @Code({ comment: '快手ID' })
    ksid: string;

    @Name({ comment: '用户名' })
    name: string;

    @Province({ default: '', comment: '省份' })
    province: string;

    @City({ default: '', comment: '城市' })
    city: string;

    @Digdit({ default: 0, comment: '粉丝人数' })
    fans_count: number;

    @Digdit({ default: 0, comment: '粉丝团人数' })
    group_count: number;

    @Code({
        comment: '状态 0 是待完善 1是已完善',
        default: '0'
    })
    status: string;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;

    @Code({ comment: '每天开播时间', default: '' })
    begin_time: string;

    @Code({ comment: '每天下播时间', default: '' })
    end_time: string;

    @Boolean({ default: false })
    has_live: boolean;

    @Code({ default: '' })
    sex: string;

    @Avatar({ default: '' })
    avatar: string;

    @Desc({ default: '' })
    description: string;

}
